-
Notifications
You must be signed in to change notification settings - Fork 15
Make crate no_std #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks good to me except for the addition of the |
|
It looks like all of the |
|
Oh I missed that. I think one option would be to use the |
|
itoa looks nice! I’ll add that in. |
|
All set, I replaced integer formatting with Also, I was able to avoid allocations for nested |
|
Excellent, thank you! |
|
Released as 0.11.0. |
|
Out of curiosity, what's your use case for running this in a no_std context? |
|
For my objdiff tool, I've been working on ensuring all dependencies are |
The majority of changes are removing reliance on
std::io. Instead of usingwrite!, we can use the infallibleVec::extend.This removed most of the error handling from
serialize, with a couple of exceptions:[invalid]to the output.VectoString. I modified this to just emit lossy UTF-8 if there are any errors. (Though I don't expect this to ever happen in practice, given thatparseshould have handled any invalid UTF-8 already)With those refactored,
serializenow returns aStringinstead ofResult<String>. This also allowed me to remove theIoerror variant entirely.#![no_std]success!Also included:
serializereturn type is an API breaking change